﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ArticleManager.DataClasses
{
    public class ArticleKey
    {
        private int article_id;
        private int key_id;

        public ArticleKey()
        {
            article_id = 0;
            key_id = 0;
        }

        public ArticleKey(int art_id,int k_id)
        {
            article_id = art_id;
            key_id = k_id;
        }

        #region propertiese

        public int ArticleId
        {
            get
            {
                return this.article_id;
            }
            set
            {
                //bool changed = !object.Equals(this._UnreadCount, value);
                this.article_id= value;
                //if (changed) OnPropertyChanged(new PropertyChangedEventArgs(Properties.UnreadCount));

            }
        }

        public int KeyId
        {
            get
            {
                return this.key_id;
            }
            set
            {
                //bool changed = !object.Equals(this._UnreadCount, value);
                this.key_id = value;
                //if (changed) OnPropertyChanged(new PropertyChangedEventArgs(Properties.UnreadCount));

            }
        }


        #endregion



        public class Properties
        {
            public const string KeyId = "key_id";
            public const string ArticleId = "article_id";
        }
    }

    public class ArticleKeysCollection : System.Collections.CollectionBase
    {
        public int Add(ArticleKey value)
        {
            return base.List.Add(value as object);
        }

        public void Remove(ArticleKey value)
        {
            base.List.Remove(value as object);
        }

        public void Insert(int index, ArticleKey value)
        {
            base.List.Insert(index, value as object);
        }

        public bool Contains(ArticleKey value)
        {
            return base.List.Contains(value as object);
        }

        public ArticleKey this[int index]
        {
            get { return base.List[index] as ArticleKey; }
        }
    }


}
